<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- <link type="text/css" rel="stylesheet" href="/${initParam.context_root }/css/tab_cscenter.css">
<link type="text/css" rel="stylesheet" href="/${initParam.context_root }/css/notice.css"> --%>
<script type="text/javascript" src="/${initParam.context_root }/script/cscenter.js"></script>
<script type="text/javascript">
function cancelForm(){
	var f1 = window.document.form_name;
	//f1.action="/${initParam.context_root }/cscenter/list.do?page=${requestScope.page }&divide=${requestScope.divide }";
	f1.action="/${initParam.context_root }/cscenter/list.do";
	f1.submit();
}
</script>
<div class="container">
	<div class="starter-template" style="padding-right: 40px; padding-top: 40px; padding-bottom: 80px">
		<div class="alert alert-info" style="width: 800px; margin: auto" >이곳은 게시글을 작성하는 곳입니다.</div>
		<br>
		<div class="well" style="width: 800px; margin: auto">
			<!-- <h3>글쓰기</h3> -->
			<form role="form" name="form_name" action="/${initParam.context_root }/cscenter/login/writeContent.do" method="post" onsubmit="return writeFormCheck(this);">
				<input type="hidden" name="divide" value=${requestScope.divide }>
				<input type="hidden" name="page" value=${requestScope.page }>
				
				<div class="form-group">
					<label for="title">제목</label>
					<input type="text" class="form-control" id="subject"  name="title" size="70">
				</div>
				<div class="form-group">
					<label for="nickname">작성자 : </label>${sessionScope.login_info.nickname }
					<input type="hidden" id="nickname" name="nickname" value="${sessionScope.login_info.nickname }">
				</div>
				<c:if test="${requestScope.divide=='7'}">
					<label for="email">수신 이메일 : </label> 
					<input type="text" class="form-control" id="email" name="email" size="40" value="${sessionScope.login_info.email }">
				</c:if>

				<textarea cols="100" rows="15" class="form-control" name="content"></textarea>
				<br><br>
				<button type="button" class="btn btn-warning" onclick="cancelForm();">취소</button>
				<button type="submit" class="btn btn-primary">등록</button>
				<button type="reset" class="btn btn-danger" onclick="return resetForm();">초기화</button>
			</form>
		</div>
	</div>
</div>